#include"UdpServer.hpp"
#include"Log.hpp"
#include"Dict.hpp"
#include"InetAddr.hpp"
using namespace kzz;


int main(int argc,char **argv)
{
    if (argc != 2)
    {
        kzz::LOG(LogLevel::ERROR) << "服务器端参数传入错误";
        return 2;
    }
    
    Dict dict;
    dict.LoadDict();


     uint16_t port=8080;
    kzz::UdpServer server(port,[&dict] (const std::string&word, InetAddr& client){
        return dict.TransLate(word,client);

    }
    );
    server.Init();
    
    server.Start();
    return 0;

}